-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remap paths in UI tests by default #105924
Conversation
7ec33cb
to
ba526ed
Compare
See the Using CI to test section of the dev guide for how to test Windows jobs in a PR. |
@ChrisDenton: Thanks for pointing out the docs! I though something like that would be possible, but didn't realize it was officially documented. (I just got back to this PR and finished setting up a windows VM...) |
c7ec808
to
1f9a3d3
Compare
r? bootstrap |
(#106657) |
I've been considering this a bit more and will be moving the first two commits to separate PRs (rental & path mapping undo). |
Update `rental` hack to work with remapped paths. This PR simply switches to an already-existing helper instead of hard-coding a specific enum variant. The new revision of the test fails without the other changes in this PR. Context: I'm exploring running UI tests with remapped paths by default in rust-lang#105924 and the rental test was one of the ones that failed. This may also be useful in the context of rust-lang/rfcs#3127 ("New rustc and Cargo options to allow path sanitisation by default").
@rustbot author |
Update `rental` hack to work with remapped paths. This PR simply switches to an already-existing helper instead of hard-coding a specific enum variant. The new revision of the test fails without the other changes in this PR. Context: I'm exploring running UI tests with remapped paths by default in rust-lang#105924 and the rental test was one of the ones that failed. This may also be useful in the context of rust-lang/rfcs#3127 ("New rustc and Cargo options to allow path sanitisation by default").
Heuristically undo path prefix mappings. Because the compiler produces better diagnostics if it can find the source of (potentially remapped) dependencies. The new test fails without the other changes in this PR. Let me know if you have better suggestions for the test directory. I moved the existing remapping test to be in the same location as the new one. Some more context: I'm exploring running UI tests with remapped paths by default in rust-lang#105924 and this was one of the issues discovered. This may also be useful in the context of rust-lang/rfcs#3127 ("New rustc and Cargo options to allow path sanitisation by default").
Should generally be ready for review, I'll ping the bot to update the labels once Windows CI is green. |
@rustbot ready |
Hm, I thought that we had a separate filtering pass which made this not true - #96551? Or is the truncation happening within rustc? |
The truncation is happening in |
Here is an example diff we see if the filename is too long:
edit: not sure if this going to work, but let's try to avoid spamming people: @rustbot ready |
Huh! This is news to me, maybe a recent change. In any case, this seems like a reasonable approach to solving that problem -- @bors r+ rollup=iffy |
☀️ Test successful - checks-actions |
Finished benchmarking commit (52372f9): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
Heuristically undo path prefix mappings. Because the compiler produces better diagnostics if it can find the source of (potentially remapped) dependencies. The new test fails without the other changes in this PR. Let me know if you have better suggestions for the test directory. I moved the existing remapping test to be in the same location as the new one. Some more context: I'm exploring running UI tests with remapped paths by default in rust-lang/rust#105924 and this was one of the issues discovered. This may also be useful in the context of rust-lang/rfcs#3127 ("New rustc and Cargo options to allow path sanitisation by default").
If you think this needs further discussions / something RFC-like, please let me know the best forum for that.
This PR runs UI tests with a remapped "src base" directory by default.
Why? Because some UI tests currently depend on the length of the absolute path to the
src/test/ui
directory. Remapping makes the tests independent of the absolute path.The path to the source file (which is absolute on CI) is part of the type name of closures.
rustc
diagnostic output depends on the length of type names (long type names are truncated). So a long absolute path leads to long closure type names, which leads to truncation and changed diagnostics.(I initially tried just disabling type name truncation, but that made some error messages stupid long (thousands of characters, IIRC)).
Additional changes:
compiletest
directives now support explicitno-
versions to disable them.Passed Windows CI in https://github.com/rust-lang/rust/actions/runs/3933100590